<script language="javascript">
function get_val()
{
	var search_val = $('#search').val();
	document.techsearch.action = "index.php?page=technology&mode=view&srch_id="+search_val;
	document.techsearch.method="post";
	document.techsearch.submit();
}
function get_val1()
{
	var search_val = $('#search1').val();
	document.techsearch.action = "index.php?page=technology&mode=view&make_id="+search_val;
	document.techsearch.method="post";
	document.techsearch.submit();
}
</script>
<link rel="stylesheet" href="css/innerpage.css" type="text/css" />
<div class="mainWarpArea">
    <div class="contentwarp">
     <div class="contentwarpMiddle">
     <?php
		if($_GET['view']=="")
		{
		?>
        <table border="0" cellspacing="2" cellpadding="2" width="730" class="TechnologyTbl">
          <tr>
            <td><form name="techsearch" method="post" >
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                  <td align="left" style="padding:10 0 10 40">
                   <h1>What are you shopping for?</h1>
                  </td>
                  </tr>
                  <tr>
                  <td>Technology gadget &nbsp;
                    <select name="search" id="search" onchange="return get_val();">
                 	  <option value="0" selected="selected">- -Select</option>
                 	 <?php  echo $base_obj->listGadget($gad_id)?>		  
                  </select>
                   Make
                  <select name="search" id="search1" onchange="return get_val1();">
                  <option value="0" selected="selected">- -Select</option>
                     <?php echo $base_obj->listMake($make_id)?>
                  </select>
                  </td>
                  </tr>
                  <td rowspan="2" align="right" valign="top"></td>
                </tr>
                <tr>
                  <td></td>
                </tr>
              </table>
              </form></td>
          </tr>
          <tr>
            <td></td>
          </tr>
          <tr>
          <?php if($_GET['mode']==""){?>
            <td style="padding-bottom:40"><script src="s_js/table.js"></script>
              <table cellspacing="0" cellpading="0" border="0" width="100%">
                <tr valign="top">
                  <td valign="top"><table cellspacing="0" cellpadding="0" brder="0" width="100%">
                      <tr valign="top">
                        <td><table border="0" cellpadding="5" cellspacing="0" width="100%">
                            <tr>
                              <td valign="top"><table cellspacing="0" cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'Laptop' and  active_status = '1'"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=120px/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='30' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										       echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                              <td valign="top"><table cellspacing="0" cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'Digital pen/ Smart pen' and  active_status = '1'"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=120px/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='28' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										       echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                              <td valign="top"><table cellspacing="0" cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'Music players/iPods' and  active_status = '1'"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=115x/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='31' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										     echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                            </tr>
                            <tr>
                              <td valign="top"><table cellspacing="0"  cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'Scientific calculator' and  active_status = '1'"; 

										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=120px/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='30' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										    echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                              <td valign="top"><table cellspacing="0" cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
											$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'Book scanner' and  active_status = '1'";
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=120px/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='28' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										     echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                              <td valign="top"><table cellspacing="0"  cellpadding="0" border="0" class="TechnologyTblIn" >
                                  <tr>
                                    <td width="110px" rowspan="2" valign="top">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET." WHERE 
										gadget_name like'camera'  and  active_status = '1'"; 

										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row($res);
								        $src=$data[gadget_image];
										echo  '<img src="uploads/gadget_images/'.$src.'" width=120px/>';
									?>
                                    
                                    </td>
                                    <td style="padding-bottom:6;padding-left:5" colspan="2"><a class="category_big" href="#">
                                    <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='30' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										    echo '<a href="index.php?page=technology&mode=view&product_id='.$data[$i]['id'].'">'.$data[$i]['make'].'</a><br>';
										}
										?></a>
                                    </td>
                                  </tr>
                                  <tr valign="top">
                                          <td style="padding:0 0 5 2" class="subcategory"><a href="#"><span>more...</span></a></td>
                                        </tr>
                                  
                                </table></td>
                            </tr>
                            </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              </td>
              <?php }
			  else
			  { ?>
              <td style="padding-bottom:6;padding-left:5;" colspan="2" >
                                     
                                     <?php 
										$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										id='".$_GET['product_id']."' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										for($i=0;$i<$count;$i++) 
										{
										     echo '<table border="0" class="viewTechnology">
											 <tr><td>'
											 .$data[$i]['make'].'
											 </td></tr>
											 <tr><td><img src="uploads/gadget_images/'.$data[$i]['image'].'" width=120px/></td>
											 <td valign="top">'.$data[$i]['specifications'].'
											 <br>price: $
											 '.$data[$i]['price'].'
											  <br>Quality:
											 '.$data[$i]['sale_flag'].'
											 <a href="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_blank"><img src="images/button_buy_now.gif" style="float:right"/></a>
											 </td></tr>
										
											 
											 </table><br>';
											 
										}
										if($_GET['srch_id']!="")
										{
									$qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										gadget='".$_GET['srch_id']."' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										if($count>0){
										for($i=0;$i<$count;$i++) 
										{
										     echo '<table border="0" class="viewTechnology"> 
											 <tr><td>'
											 .$data[$i]['make'].'
											 </td></tr>
											 <tr><td><img src="uploads/gadget_images/'.$data[$i]['image'].'" width=120px/></td>
											 <td valign="top">'.$data[$i]['specifications'].'
											 <br>price: $
											 '.$data[$i]['price'].'
											  <br>Quality:
											 '.$data[$i]['sale_flag'].'
											 <a href="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_blank"><img src="images/button_buy_now.gif" style="float:right"/></a>
											 </td></tr>
										
											 
											 </table><br>';
										}
										}
										 else
										  {
											echo '<p style="text-align:center;font-weight:bold">No Items Found</p>';
										  }
										}
										if($_GET['make_id']!="")
										{
								         $qry = "select * from ".$base_obj->GEDGET_TECH." WHERE 
										make like '".$_GET['make_id']."%' and active_status = '1' order by make asc  LIMIT 0,5"; 
										$res = $base_obj->exec_query($qry);
										$data = $base_obj->fetch_row_all($res);				
										$count = count($data);
										if($count>0){
										for($i=0;$i<$count;$i++) 
										{
		if($data[$i]['image']=="")
		{
		$source ='<img src="images/noimage.jpg" width="80px" />';	
		}
		else
		{
		$source ='<img width=80px  src="uploads/gadget_images/'.$data[$i]['image'].'"/>';
		}
											 echo '<table border="0" class="viewTechnology"> 
											 <tr><td>'
											 .$data[$i]['make'].'
											 </td></tr>
											 <tr><td>'.$source.'</td>
											 <td valign="top">'.$data[$i]['specifications'].'
											 <br>price: $
											 '.$data[$i]['price'].'
											  <br>Quality:
											 '.$data[$i]['sale_flag'].'
											 <a href="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_blank"><img src="images/button_buy_now.gif" style="float:right"/></a>
											 </td></tr>
										
											 
											 </table><br>';
										}}
										else
										echo '<p style="text-align:center;font-weight:bold">No Items Found</p>';
										}
										?>
                                    </td>
                                    <?php }?>
              
          </tr>
          <tr>
            <td background="s_images/20/mdh2.gif"><img src="s_images/spacer.gif" height="2" width="2"></td>
          </tr>
          
        </table>
        <?php }

else if($_GET['view']=='advertise_products')
{
	include('advt_prod.php');
}

?>
      </div>
      <!-- End contentwarpMiddle -->
     <div class="contentwarpRight">
      <?php include("includes/right_content.php");?>
      </div>
      
   
      
      <!-- End contentwarp -->
      <div style="clear:both;"></div>
    </div>
    <!-- End mainWarpArea -->
    <div style="clear:both;"></div>
  </div>
  <!-- End Wrapper -->
